home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
lang
/
SmallEiffel.lha
/
SmallEiffel
/
bin_c
/
pretty14.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-22
|
7KB
|
388 lines
/*
-- ANSI C code generated by :
-- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.79) --
-- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
-- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr --
-- http://www.loria.fr/SmallEiffel --
*/
#include "pretty.h"
T6 r265is_reference(T265* C){
T6 R=0;
R=X62is_reference((C)->_run_type/*12*/);
return R;
}
/*No:TYPE_FORMAL_GENERIC.written_mark*/
void r265error(T0* a1,T0* a2){
r37add_position(a1);
r37error((T37*)(oBC11eh),a2);
}
void r265make(T265* C,T0* a1,T2 a2){
C->_rank=a2;
C->_formal_name=a1;
}
T6 r265is_none(T265* C){
T6 R=0;
R=X62is_none((C)->_run_type/*12*/);
return R;
}
/*No:TYPE_FORMAL_GENERIC.pretty_print*/
T6 r265is_array(T265* C){
T6 R=0;
R=X62is_array((C)->_run_type/*12*/);
return R;
}
void r265fatal_error_generic_list(T265* C){
r37add_type((T0*)C,((T0*)ms62_29184));
r37print_as_fatal_error((T37*)(oBC11eh));
}
T0* r265constraint(T265* C){
T0* R=NULL;
R=((T263*)(r265formal_arg(C)))->_constraint/*4*/;
return R;
}
/*No:TYPE_FORMAL_GENERIC.fz_bga*/
/*No:TYPE_FORMAL_GENERIC.is_like_argument*/
T6 r265is_double(T265* C){
T6 R=0;
R=X62is_double((C)->_run_type/*12*/);
return R;
}
T0*oBC11manifest_string_pool=NULL;
/*No:MANIFEST_STRING.start_position*/
/*No:MANIFEST_STRING.to_string*/
T0* r154add_comment(T154* C,T0* a1){
T0* R=NULL;
/*[IF*/
if(((a1)==((void*)(NULL)))||((/*(IRF4.6count*/r32count(((T32*)((((T64*)a1))->_list/*4*/)))/*)*/)==(0))){
R=(T0*)C;
}
else{
{T214*n=malloc(sizeof(*n));
*n=M214;
r214make(n,(T0*)C,a1);
R=(T0*)n;
}
}
/*FI]*/
return R;
}
T2 r154to_integer(T154* C){
T2 R=0;
r154error((C)->_start_position/*4*/,((T0*)ms12_45846));
return R;
}
void r154bracketed_pretty_print(T154* C){
T2 _column=0;
T2 _i=0;
_column=((T310*)(oBC11fmt))->_column/*8*/;
r310put_character((T310*)(oBC11fmt),'\42');
_i=1;
while (!((_i)>(((T7*)((C)->_to_string/*8*/))->_count/*4*/))) {
/*[IF*/
if(r154is_on_next_line(C,_i)){
r310put_string((T310*)(oBC11fmt),((T0*)ms154_100));
while (!((_column)==(((T310*)(oBC11fmt))->_column/*8*/))) {
r310put_character((T310*)(oBC11fmt),'\40');
}
r310put_character((T310*)(oBC11fmt),'\45');
}
/*FI]*/
r154pretty_print_character(C,_i);
_i=(_i)+(1);
}
r310put_character((T310*)(oBC11fmt),'\42');
}
void r154pretty_print_character(T154* C,T2 a1){
T2 _val=0;
/*[IF*/
if((((C)->_percent/*20*/)!=((void*)(NULL)))&&(r155fast_has((T155*)((C)->_percent/*20*/),a1))){
/*[IRF3.3clear*/((((T7*)((T7*)(oBC154tmp_string))))->_count)=(0);
/*]*/
r154character_coding(/*(IRF4.6item*/(((T7*)((C)->_to_string/*8*/))->_storage/*0*/)[(a1)-(1)]/*)*/,oBC154tmp_string);
r310put_string((T310*)(oBC11fmt),oBC154tmp_string);
}
else if((((C)->_ascii/*16*/)!=((void*)(NULL)))&&(r155fast_has((T155*)((C)->_ascii/*16*/),a1))){
_val=((unsigned char)/*(IRF4.6item*/(((T7*)((C)->_to_string/*8*/))->_storage/*0*/)[(a1)-(1)]/*)*/);
r310put_string((T310*)(oBC11fmt),((T0*)ms154_174));
r310put_integer((T310*)(oBC11fmt),_val);
r310put_string((T310*)(oBC11fmt),((T0*)ms13_48));
}
else{
r310put_character((T310*)(oBC11fmt),/*(IRF4.6item*/(((T7*)((C)->_to_string/*8*/))->_storage/*0*/)[(a1)-(1)]/*)*/);
}
/*FI]*/
}
void r154character_coding(T3 a1,T0* a2){
T3 _special=0;
{int z1=a1;
if((64==z1)){
_special='A';
}
else
if((8==z1)){
_special='B';
}
else
if((94==z1)){
_special='C';
}
else
if((36==z1)){
_special='D';
}
else
if((12==z1)){
_special='F';
}
else
if((92==z1)){
_special='H';
}
else
if((126==z1)){
_special='L';
}
else
if((10==z1)){
_special='N';
}
else
if((96==z1)){
_special='Q';
}
else
if((13==z1)){
_special='R';
}
else
if((35==z1)){
_special='S';
}
else
if((9==z1)){
_special='T';
}
else
if((0==z1)){
_special='U';
}
else
if((124==z1)){
_special='V';
}
else
if((37==z1)){
_special='\45';
}
else
if((39==z1)){
_special='\47';
}
else
if((34==z1)){
_special='\42';
}
else
if((91==z1)){
_special='\50';
}
else
if((93==z1)){
_special='\51';
}
else
if((123==z1)){
_special='\74';
}
else
if((125==z1)){
_special='\76';
}
}
r7extend(((T7*)a2),'\45');
/*[IF*/
if((_special)==('\0')){
r7extend(((T7*)a2),'\57');
r2append_in(((unsigned char)a1),a2);
r7extend(((T7*)a2),'\57');
}
else{
r7extend(((T7*)a2),_special);
}
/*FI]*/
}
T0* r154to_runnable(T154* C,T0* a1){
T0* R=NULL;
/*[IF*/
if(((C)->_mangling/*24*/)==((void*)(NULL))){
C->_mangling=r356register((T0*)C);
}
/*FI]*/
R=(T0*)C;
return R;
}
/*No:MANIFEST_STRING.us_slash*/
/*No:MANIFEST_STRING.fz_iinaiv*/
/*No:MANIFEST_STRING.result_type*/
void r154break_line(T154* C){
/*[IF*/
if(((C)->_break/*12*/)==((void*)(NULL))){
C->_break=se_ma155(1,
(((T7*)((C)->_to_string/*8*/))->_count/*4*/)+(1));
}
else{
r155add_last((T155*)((C)->_break/*12*/),(((T7*)((C)->_to_string/*8*/))->_count/*4*/)+(1));
}
/*FI]*/
}
/*No:MANIFEST_STRING.percent*/
T6 r154is_on_next_line(T154* C,T2 a1){
T6 R=0;
/*[IF*/
if(((C)->_break/*12*/)!=((void*)(NULL))){
R=r155fast_has((T155*)((C)->_break/*12*/),a1);
}
/*FI]*/
return R;
}
T0* r154twin(T154* C){
T0* R=NULL;
R=malloc(sizeof(*C));
*((T154*)R)=*C;
return R;
}
void r154print_as_target(T154* C){
r310put_character((T310*)(oBC11fmt),'\50');
r154pretty_print(C);
r310put_character((T310*)(oBC11fmt),'\51');
r310put_character((T310*)(oBC11fmt),'\56');
}
/*No:MANIFEST_STRING.add*/
void r154error(T0* a1,T0* a2){
r37add_position(a1);
r37error((T37*)(oBC11eh),a2);
}
/*No:MANIFEST_STRING.precedence*/
void r154make(T154* C,T0* a1){
C->_start_position=a1;
{T7*n=malloc(sizeof(*n));
*n=M7;
r7make(n,0);
C->_to_string=(T0*)n;
}
}
void r154add_percent(T154* C,T3 a1){
r7extend((T7*)((C)->_to_string/*8*/),a1);
/*[IF*/
if(((C)->_percent/*20*/)==((void*)(NULL))){
C->_percent=se_ma155(1,
((T7*)((C)->_to_string/*8*/))->_count/*4*/);
}
else{
r155add_last((T155*)((C)->_percent/*20*/),((T7*)((C)->_to_string/*8*/))->_count/*4*/);
}
/*FI]*/
}
/*No:MANIFEST_STRING.is_current*/
/*No:MANIFEST_STRING.break*/
void r154pretty_print(T154* C){
T2 _column=0;
T2 _i=0;
_column=((T310*)(oBC11fmt))->_column/*8*/;
r310put_character((T310*)(oBC11fmt),'\42');
_i=1;
while (!((_i)>(((T7*)((C)->_to_string/*8*/))->_count/*4*/))) {
/*[IF*/
if(r154is_on_next_line(C,_i)){
r310put_string((T310*)(oBC11fmt),((T0*)ms154_100));
while (!((_column)==(((T310*)(oBC11fmt))->_column/*8*/))) {
r310put_character((T310*)(oBC11fmt),'\40');
}
r310put_character((T310*)(oBC11fmt),'\45');
}
/*FI]*/
r154pretty_print_character(C,_i);
_i=(_i)+(1);
}
r310put_character((T310*)(oBC11fmt),'\42');
}
/*No:MANIFEST_STRING.is_void*/
/*No:MANIFEST_STRING.mangling*/
T0*oBC154tmp_string=NULL;
void r154add_ascii(T154* C,T3 a1){
r7extend((T7*)((C)->_to_string/*8*/),a1);
/*[IF*/
if(((C)->_ascii/*16*/)==((void*)(NULL))){
C->_ascii=se_ma155(1,
((T7*)((C)->_to_string/*8*/))->_count/*4*/);
}
else{
r155add_last((T155*)((C)->_ascii/*16*/),((T7*)((C)->_to_string/*8*/))->_count/*4*/);
}
/*FI]*/
}
/*No:MANIFEST_STRING.ascii*/
/*No:MANIFEST_STRING.atomic_precedence*/
int fBC11type_string=0;
T0*oBC11type_string=NULL;
T0* r154type_string(void){
if(fBC11type_string==0){
fBC11type_string=1;
{T256*n=malloc(sizeof(*n));
*n=M256;
r256make(n,NULL);
oBC11type_string=(T0*)n;
}
}
return oBC11type_string;}